package com.api.shopapi.service.impl;

import com.api.shopapi.entity.RechargeGroup;
import com.api.shopapi.mapper.RechargeGroupMapper;
import com.api.shopapi.service.RechargeGroupService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("RechargeGroupServiceImplOne")
public class RechargeGroupServiceImpl  implements RechargeGroupService {

    @Autowired
    private RechargeGroupMapper rechargeGroupMapper;

    @Override
    public int insert(RechargeGroup rechargeGroup) {
        return rechargeGroupMapper.insert(rechargeGroup);
    }

    @Override
    public PageInfo<RechargeGroup> getListForPage(int pageIndex, int pageSize, String governmentCode) {
        PageHelper.startPage(pageIndex,pageSize);
        List<RechargeGroup> rechargeGroupList=rechargeGroupMapper.getListForPage(governmentCode);
        return new PageInfo<>(rechargeGroupList);
    }
}
